﻿-----------------------------------------------------------------------------------------------
------------------------------pca_tareas.desencadenadores--------------------------------------
-----------------------------------------------------------------------------------------------

CREATE OR REPLACE FUNCTION pca_tareas.fn_get_list_desencadenadores()RETURNS SETOF pca_tareas.desencadenadores AS
$$
DECLARE
	_row pca_tareas.desencadenadores%ROWTYPE;
BEGIN
	FOR _row IN
		SELECT
			*
		FROM
			pca_tareas.desencadenadores
	LOOP
		RETURN NEXT _row;
	END LOOP;
END;
$$
LANGUAGE plpgsql;

-----------------------------------------------------------------------------------------------
--------------------------------pca_tareas.dias_semana-----------------------------------------
-----------------------------------------------------------------------------------------------

CREATE OR REPLACE FUNCTION pca_tareas.fn_get_list_dias_semana()RETURNS SETOF pca_tareas.dias_semana AS
$$
DECLARE
	_row pca_tareas.dias_semana%ROWTYPE;
BEGIN
	FOR _row IN
		SELECT
			*
		FROM
			pca_tareas.dias_semana
	LOOP
		RETURN NEXT _row;
	END LOOP;
END;
$$
LANGUAGE plpgsql;

-----------------------------------------------------------------------------------------------
---------------------------------pca_tareas.dias_mes-------------------------------------------
-----------------------------------------------------------------------------------------------

CREATE OR REPLACE FUNCTION pca_tablas.fn_get_list_dias_mes() RETURNS SETOF pca_tareas.dias_mes AS
$$
DECLARE
	_row pca_tareas.dias_mes%ROWTYPE;
BEGIN
	FOR _row IN
		SELECT
			*
		FROM
			pca_tareas.dias_mes
	LOOP
		RETURN NEXT _row;
	END LOOP;
END;
$$
LANGUAGE plpgsql;

-----------------------------------------------------------------------------------------------
------------------------------------pca_tareas.meses-------------------------------------------
-----------------------------------------------------------------------------------------------

CREATE OR REPLACE FUNCTION pca_tablas.fn_get_list_meses() RETURNS SETOF pca_tareas.meses AS
$$
DECLARE
	_row pca_tareas.meses%ROWTYPE;
BEGIN
	FOR _row IN
		SELECT
			*
		FROM
			pca_tareas.meses
	LOOP
		RETURN NEXT _row;
	END LOOP;
END;
$$
LANGUAGE plpgsql;